package com.zoro.barn.business.service.sqldocument.server.facade;

import com.zoro.barn.business.service.sqldocument.server.BarnProjectServer;
import com.zoro.barn.dto.pp.project.BarnProjectInfoDto;
import com.zoro.barn.dto.pp.project.projectinfodto.GetProjectInfoInfosReq;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author zhaoxingwu
 */
@Component
public class BarnProjectServerFacade {

    private final BarnProjectServer barnProjectServer;


    public BarnProjectServerFacade(BarnProjectServer barnProjectServer) {
        this.barnProjectServer = barnProjectServer;
    }

    public Map<String, BarnProjectInfoDto> getByIds(String[] ids) throws Exception {
        GetProjectInfoInfosReq req = new GetProjectInfoInfosReq();
        req.setIds(ids);
        return this.barnProjectServer.getProjectInfo(req);
    }
}
